Fix comments and finish JS logic.