created own function for legend creation
reorganized
Merge pull request #33 from jpecht/master

reorganization