Better memory implementation with void arrays