updated test and document script