copypasting the direct routines