ymax wasnt passed through as a parameter