Revert "applied fixes and some changes, see desc."

This reverts commit 3308d33dfd141d21f045af56fc919e24f548c431.