Added main program and checks for the expected argument length