Loewenstein implemented with bugs
removed malloc/calloc, using fixed-length arrays.