added constants, fixed broken jmps, fixed writing too much data