fixed the misinterpreted code