undo last changes, this needs more thorough testing