Adds score functionality, cleans up some code