Improved use of select, still not working