started working on server loop