First pass at a real function flipper