added joining room function
adding some comments