added score counter and cleaned up