Logic error fixed!