modified to handle locations with both line and cols.