added variable to calculate range left