Added some extra commenting to explain a few things