Change spaces to tabs
Use function addElement
Delete not used code