You need to take a step back and be sure you know what it is you are trying to implement before you try to implement it.
First step in the problem solving process: make sure you understand the problem you are trying to solve. It's also often the hardest part of the problem solving process.