updated as per bryans comments