this is exactly what i wanted
do you think you could comment it for me to explain what each part does?

Thankyou for your help