this is the function for the 4 variables

This has all the code needed for testing, a lot will have to be removed
when integrated into main.