Changed format of score function
Added a solve funtion