Add tests and implementation fot step 3