added gtest lib, improved buffermanager compared to the solution given per email