I think I'm slowly reaching my limit Solution for part two (which would also work for part 1) made me realise that I should probably (re-)read those math books and learn the basics again