Adding some needed functions