Corrected vector magnitude calculation. Corrected program execution.