working ia (note perfect but working)