Restructured everything, in particular the shape distribution methods.
There is an unresolved issue with identifying the shapes in parallel,
although it works fast without it. Total time on my system was 1,3
seconds.