Fixed Scoring Issues

put the scoring algorithm into the main function, because it was
simpler than fixing it outside of the main funcion.