Function removal and pserveElements[i] added instead of this

Signed-off-by: Ralf Koller <r.koller@gmail.com>