added test file, reworked program flow