Code for generating visuals and score