added new features, a popup menu and some fixes