working on xwing code