rewrite js for questions