haven't got to test this yet, but should this be >= ? (cause of zero-index)