changed opacities, layer order, refactored code