Creating elements using code instead of string