The code is quite obvious and works ok. Why it does not pass?