Added static to some of the functions that could use it