Sept2 Added file outputs for gradients, fixed rotation direction issues