cleaned up and made a couple fixes