various bugs fixed, added modes to Element