Revert to last working version

WIP changes are in a separate branch