Code adpated in order to use StoryBoard