Please format your code and post in a code block as requested by the forum guidelines
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in a code block.
Please provide a better description of the issues.
How are your switches wired? Schematic please?