fixed out of bounds error
more output