added switch statement. fixed bugs, and is now able to find the correct parts to insert in the parity bits