average is now computing properly and debugging statements are working properly