added logic for inserting
small memory improvement
corrected choosing the room
small fixes