Change to structs and add ptr functions