the answer is in the file i linked below and i tried to do as much work as I can for it not to be messy