updated test code with the one used in demo