Cleaned up and adding comments