added check for valid start coordinates