improved history, added break calculation