added src files

Declare variables at first point of use, not ahead of time.