removed write(*,*) statements