better interface and a logical problem fixed