fixes

small bugs but for the most part works