rewritten as class