some changes, not tested yet