Ugly code but working #2