Set up primary function and some other jazz