fixed addressing, array length bugs