adding require
transfer to engine and rewrite