Added some comments; removed some unused features/variables.