Cleaned up Code

Added comments, deleted old code