Adding more code for better functionality, view and setup finished