working logic

left to do input check and reading network settings for client