another implementation to support scripts and comments