did some testing, not finished yet, some fixes