fixed latex errors and added legend png