Added some comments and fixed syntax errors

There were some syntax error in the file, like 'dn' in place of 'tn' etc. This pull request consists of changes required to run the file without any errors