initial beta test code
cleanup, add comments