added remote code and bunch of other stuff