Negative score test added
Minor optimization