changes inspired from Jeff