adding stats code
Adding DB mapper.