hopefully, working mputils code