added optimized thelma
added optimized thelma code