Removed some deprecated stuff. Fixed some comments. Added a println for debugging.