major fixes based on review feedback