Greatly simplified, but already slightly useful