latest code wih partial implementation of the invite contacts requirement