logic corrected.