incorporated feedback from tatham