implement two versions of reverse() for SLList