write PSLOC counter class and test it