Added input verification (#2)