Thanks to @JoakimDanielson this question has been answered! For future viewers the problem was that I was using classes instead of structs.