replace print_cell function with a simpler array lookup. minor style fixes