some useable lua functions and c functions