Changed code to no longer accept spaces or emptystring