added private variables with closures