Fixed bugs, most of it works now (2)