implementing passage way and cell code.