Final rewriting for 3k version