Update file hierachy; socket write
fix imports