displaying the folder only

i need a way to display the name of a file only. when i go

set x to choose file
dispay dialog x

it displays the path to the file. how do i change this?

set x to (choose file)
set n to name of (info for x)
display dialog n