added mcstas capabilities, made functions for deperate file types