no idea why substring was used.