Removed unnused imports and fixed small bug