added scoring, fixed bugs