Code optimization + bug fixing

	scoreboard wasn't behaving properly