updated client code, added internal things