some changes, need some more tweaking