implemented array lock.

final commit for now.