added rudimentary stats tracking