wrote tray.c