function implementation

randomized pattern
pattern matches song's beat
code clean up