added interactive polygon algorithm