added legend option for splitting