added default argument in GetElement
changed Nelement to Nelements