sample6ter complete code and test