working on setLastFlatPosition