removed function object
function object to lambda
typedefs, warning cleanup, getting rid of unneeded variables