Updated the code a little so it made more sense.