fixed the issues pointed out by Prof. Stump