Adding some helpful functions.