Sort out spaces