Added the capability to run headless using parameters.