Adding default for resolution and resolution validation
Adding better resolution handling and some comments