Added some comments and renamed constants