Added typedef for bool
Long explanation of splitting to force mayself to understand the problem