finished setup and majority of code