Added view creation function.