tried to rewrite it