cleanup of code
-added enviornment
-added possibility to get arbitrary counters