This works but it is prone to F.O.U.C: