Added a method that strips consecutive whitespace