Fixed bugs, and now working