Redid CN calculation in fortran, added comments