Cleaned up code a little and added more comments