removed extra lambdas and debugging stuff