introducing various functions

inspired and got some test sources from ghost project