Corrected History Function