assign_color and related global variables added