simple scanf and small improvements