Updated to allow specifying input filename as argument