clean up spaces and split into array