Added some function definitions