adjustments and bugfix to prior commit