Updated code documentation. Fixed TPIC/SN issue.