revision: append to list instead of insert and reverse