cleaned up code for social