got reverse function to actuallly work