Added scores and refactored code