this might help! see inside, i have comments explaining what i do, hopefully you can learn something!