Added commented documentation to explain the code