thanks for your suggestions!
i have removed all the unnecessary delays from the library and those which still remains there are the requirement of the hardware in order to get working!
i have no experience of writing my own functions and get them working so that's why i am having problems !