Made score prints conditional to avoid accessing invalid array indices