implemented required TODOs in SynchronizedQueue of Assignment 0