First sort of working version of select