added client stuff and middleman class