i'm having trouble adding them all togehter
Where in your code is the problem?
Single letter variable names except for loop indexes are NOT a good technique. Without any comments it takes too long to figure out what your code is trying to do.
Use a longer variable names that describes what the variable is used for.
I see several methods in your code. What are they supposed to do?
Add the comments to the code, don't post them here outside the code.