some modifications
merged