Reindented
Use printf
Some more sanity checks