added a few functions to misc.el