Changed structure and added user inputs