i wasn't happy with my first code, so i began changing it to be more versatile.
this is my first "working" version