paint functions in canvas with the correct values in formula