#1 huge fixes, added element locking