Added brick entering algorithm