Refactored, flippers partially functional