lot of bug fixes

lot of bug fixes. works now!