cleaned up, gradient is still buggy but works