Added some functions and structs, still in progress.