Added tests for the polygon function