minor changes to accomodate resolution variable as an array instead of an integer