Removed unused stuff; formatted code.