discount function added to repo