I’m currently at work so I can’t delve deeper into it but have you checked out the great tutorial on here? They can really help understand why the code works.
If you have already checked these out and still need help then I’ll try to help more when I get home later.