Introduction of last first algorithm