added flashing effect, refactored a bit