set up init and all functions