adding def
resolving of vars
refactor operations