deleted start and end pos variables.