Finished code for initialization and wrote code for producing payload keys