Added structs and more typing