reverse function

added useful functions - another way of doing things

commented out console.warn to get rid of warnings