updated code to use command-line arguments for width and height if present.