close to working but we have a while(11) loop that is hanging