Implemented element position adjustment algorithm..
	looks like its working fine for levels 0, 1 and 2 but gets more
	complicated from level 3 onwards....