Removed Threading, Added some optimizations