copied from kernel and commented out some functions