Form loading code mostly completed for sample