improved the functions file more.