initial file parsing and logic setup