Updated edge object creation code.
Added function for polygon object creation.