started using samples model to drive javascript