main redesign and some formating changes -running off old database setup because of pg errors