major fixes after testing