Commented debug logging which was causing errors, removed unused
variable