added interface and bug fixes.