Fixed bugs, it works now