implement load program function