Finished n-gon function
Updated array to correct type