Code for the facebook part of the system