bunch of changes probably a 1000 logic errors