Implemented keys and locks. Close #4