improvements from Jolly