function isMonotone_dict(points){
var keys = Object.keys(points)
var minx = points[keys[0]]
var maxx = points[keys[0]]
var vCount = 0
for(var i = 1; i < keys.length; i++){
if(minx.x > points[keys[i]].x){
minx = points[keys[i]]
}
if(maxx.x < points[keys[i]].x){
maxx = points[keys[i]]
}
}
var currx = minx.x
var now = (points[minx.v_edge].x != minx.x) ? "v" : "h"
var nextx = (now == "v") ? points[minx.v_edge] : points[minx.h_edge]
while(currx != maxx.x){
if(nextx.x < currx){
vCount++
}
currx = nextx.x
now = (now == "v") ? "h" :"v"
nextx = (now == "v") ? points[nextx.v_edge] : points[nextx.h_edge]
}
while(nextx.x != minx.x){
if(nextx.x > currx){
vCount++
}
currx = nextx.x
now = (now == "v") ? "h" :"v"
nextx = (now == "v") ? points[nextx.v_edge] : points[nextx.h_edge]
}
return (vCount <= 0)
}