Cooling And Entangling Ultracold Atoms