modified to send selections as arrays, updated CS library