minor
better interface and fixed a small bug