Comments and minor code modifications