Prepared code to support multiple selected objects