fixed totalling calc at last