Adding some functions

Adding some functions that helps to increase performance