add UI interface; some minor bug fixes on author's code