Refactored code added more comments, and added another gem