Finished most of the setup routines.