finished but some stuff doesn't work
after a few commands the read/writer runs into deadlocks. not sure exactly why