add legends, fix tips' position