wrestled with js object model. got forward sampling to work in a hacky way.