Well this is ugly and imho not even fast.