Got working

Z flip needs more testing