moved the implementation of list::reverse into a separate file