Handy utility functions for mathematica