added the ability to use functions with up to 5 parameters