Now compiles. Functions starting to take form.