put back tests and fixed them for current implementation