some input checks added: remove whitespaces