also this script represents the first time i seriously used the debugger and breakpoints
unfortunately i couldnt debug some of it (like the 'hanging' issue since it took fucking ages with the debugger on lmao