added typedefs for the structs

makes all the rest more readable.
Also removed line breaks from function parameter lists.