add writeBytes method, fixed some mission stuff