Rewrited, now correct