added socket and stuff