Added semi-working version of the form generation mechanism