add reversed list algorithm