fixes inf bug in assg3