changed palette and added resetting