adding scoreboard and fixing bugs