Cleaned up code. Added information to answers.