code cleanup; fix up the flipper giving up