Sanitised and documented main functionality; breaks build.