added some inline comments