facebook code written, not tested
more facebook logic, typofixes