Removing spaces and unecessary functions