How artificial intelligence works and how to create it (part 1)