I could probably add a few more lines but this is already hella complicated.