Follow this guide
1. Factory data reset
2. Clear cache partition
3. Wipe Davlik Cache
4. Format sd card
5gZGgkT2jFA
By doing the above you will give your phone a clean base to install a stock or custom rom. Once the phone is flashed then perform another factory data reset just to finally flush...