Fixed bugs - should test before pushing