Revise block function to be more general, add a mac type as well. Add input validation for command line arguments.