Cleaned up Gabriel Code and added comments