Added some javadoc. Note thatthis clas might be changed to use
observerpattern instead of lock pattern if that is wanted i the gui.
Added some javadoc and implemented the rest of the methods.