first iteration of singlethreaded buffermanager. Probably still not working