added flap event listener, refactored a couple of methods, little styling