code has been done and teste 3 cases