corrected constructor and removeWhitespace