improvements to last version