cleaned up log calls and made flipping work