rearranged painter ui and renamed variables to make more sense