Working on history funtion.