buncha changes and fixes