Implemented file decoding.
Added command line options to specify the dimensions.