incorporated some suggestions from Shaun