added edge color (and some cleaning)