updated test, reorganized source