cleans up combine like terms and swap