scanf test
better implementation for scanf