Added some new performance fixes and new functions