added user interface algorithm