wrote sort method for sortby
removed spaces