small modifications from PR feedbacl