Update closure, created private variables. Added debug method.