lots of optimizations and refactoring done
typo
typo again
added disable function back because forgot