add location converting function to starts and lengths