Improved build_riskinputs