Added end condition for the constructURL method

Added if statement that will break the for loop if the end of the array
list is reached.

maxCoords is now  and int + index. Will probably edit this.