fixed code thanks to suggestion by Sharon Howard