Adding modifications suggested by Caleb