revert last commit and do it better