added init func and using config vars