Adding some more comments and improving the impl