valleyScore implementation