encapsulation and more methods

Need to finish the project by using Conditions, or anything that can
coordinate the threads to wait for one another.