Creating Function! Not working Properly

You are absolutely correct and i'm sorry for not knowing that that can be done