Fixed major bug in the reverse() method. Now it works perfectly