new style and code rewrite!