some small optimizations; added fade-out effect for beam; need to fix
algorithm for positioning beam parts with different sizes.