fixed paint functions to run on linux, fixed variable names