Updated input checking; far from complete.