implementation of Trick