incorporated changes based on feedback from jbalogh