Logic error corrected; silly syntax error fixed