Fixed bugs, now functional