changed global variables to a global object, added facebook button