updated code for onion skin effect