implementing #44 #45 #46 #47