polygon functionality added. not complete yet