Modified to become a general-purpose command-line applications