added multiline output + few minor fixes
now using maxval 255