Added basic input recognition. Few minor changes throughout.