Welcome to the forum 18bilal-up!
Aside from formatting the code as already suggested in order to make it easier to read (please use the CODE tags), can you elaborate please on what "it doesn't function" mean? What exactly is the problem? What is or is not happening? What do you expect to happen? Is it not happening when the code is compiled, or after it has been uploaded? If its not compiling, then what errors are you getting?
Try to be as specific as you can about the problem so that those reading your comment can understand what is going on and be in a better position to help.