Add edditing events, fix home page link, rearranged code