fixes after consulting Mike Hildreth