changed handling of perioic boundary conditions, added struct.h and extendedmath.h, did some other shit...