working on initialization function