testing and implementing functional functions