reviewed code and fixed tests