address AMO editors review comments, and add more code comments