Got rid of Elem function, should be faster