added the new select method and clean up