Added some comments and removed some deprecated lines