added comments for implementation