need to fix lines 520-523