Removed unused vars and import + added some comments