Fixed many bugs, still not working at it should. WIP