fleshed out init function