fix citations and improve build script