direction overflow not working fine
added boundary.