major fixes everywhere