added N and h to end of writemode, added plotfield.m