Comments and minor optimazations