temp version of reverse()