Reimplement some of the functions.

Signed-off-by: darkestkhan <darkestkhan@gmail.com>