Possible implementation
Add test and correct one small problem