Removed unused variables.
Using logger instead of dprint.