added a couple of util functions