substring completely recursive now, but a bit long