some clever trickery