add survey name check, some formatting
Complete functionality with cleaner code. Needs CSS