use malloc, normalize solution vector