more comments and a bug fix (thanks Yong Kiam)