fixed output bug reported by Kirk Waters