some modifications on ex 2.39
ex 2.40-2.41