Revert "Refactored the single parts of the program into separate functions"

This will lead to zsh killing my program. Maybe parameters are copied
and exceed memory or something
This reverts commit 06bd4d09b21467b459fa987bf2e89bf3dd3f3965.