implement edge condition and device format

define format based on the resolution and implement mechanism to
restrict displacement over the grid