what is a residential purchase agreement