resubmitted with gtest implementation