Improved interface. Fixed bug.