cleaned up a bit (removed variables from global namespace)