Fix many bugs, add legend