Used closure to allow for encapsulation of variables/functions.