fixed the bugs in the last commit - seems i had gotten a little rusty
from not coding myself in a while.
the bug was related to me having forgotten that event listeners need a
wrapper function due to call sequencing