added missing code, changed UI