FOX now works! Ugly code, needs to be cleaned.