made more improvements and fixes