solution for removing spaces