re-indented, ready to merge