checkpoint
proper flushing and corrected logic