setting up all fields and processing.