fixed viewer legend on init
added license, fixed formating, cleanup