Form functionality

Added funcitonality to form and made a few other subtle changes.