added a few generalized functions