optimized paintbrush function so that code wasn't repeated....DRY!