adds error checking to makeSerpInp.m