rewriting for the gem