Fix to use Selection instead of workArray
formatting clean up

code and layout