Changes to method signatures to include array lengths. This should make it clearer who is responsible for allocating memory.