working solution for lines, poly and circles