simplified code by just shoving stuff into global variables for now...