renamed some variables on is, added several lambda functions,