boarder check

incomplete implementation