changed challengeinterval to 10 secs
cleaned up the code a little bit