Added code for creating elements