works in three (3!) dimensions