Added some more optimization