add len method to flip