might have caused functional changes. Also because I removed use of gets() and the previous version should be marked insecure.