Version with all code together so far