Achievements fix and code cleanup
major bug fix with popup

Success box not enclosed in the correct for loop hence making it always
true