Rewrite from scratch ; correctly implements runtime initialisation and argument parsing