I was being stupid, but yeah, code works