Fixed bugs. Almost there.