Refactored, put stacks in a separate file, created new function to displays errors