Added skeletonization and made some tweaks