solution with Procs