Add some more comment to explain the code