stats implemented and small bug fix