Now accepts config options
removed unnecessary comments