Removed debug printf's and added some comments