added base stat processing code