added the counter class. Broken some nosetest by changing error class, will fix in next commit