fixed bug in my schoolboy mathematics