Wrote most function and variable declarations