Input checking, fixed indentation to 8space so it looks better on github, test file update)