changed methods for adding elements