changed directory construction
separated ui from logic code.