Added all palette-related routines and improved labels