removed some debugging stuff and moved variables into function scope
changed naming of class names and init function