Added simple input validator. Not all the way complete though.