Deleted some unused code and cleaned up debugging messages.