add bin and global functions for spark