added new palette code