cleaned up a lot and made into many files