Modified to allow multiple elements