Create an algorithm to find the common elements in two lists.
Here is a step-by-step algorithm for finding the common elements in two lists:

1. Initialize a new list called 'output' to store the common elements.
2. Iterate through each element in 'list1' using a for loop.
3. For each element in 'list1', check if the element is also present in 'list2' using an if-statement and the 'in' keyword.
4. If the element is present in both lists, append it to the 'output' list.
5. Once the loop finishes, the 'output' list will contain all the common elements.

Here is the Python code that implements this algorithm:
```
list1 = [1,2,3,4,5]
list2 = [2,4,5,6,7]
output = []

for elem in list1:
    if elem in list2:
        output.append(elem)

print(output)
```
This code will output the list `[2,4,5]`, which are the common elements in 'list1' and 'list2'.
list1 = [1,2,3,4,5]
list2 = [2,4,5,6,7]
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:
Create an algorithm to find the common elements in two lists.

### Input:
list1 = [1,2,3,4,5]
list2 = [2,4,5,6,7]

### Response:
Here is a step-by-step algorithm for finding the common elements in two lists:

1. Initialize a new list called 'output' to store the common elements.
2. Iterate through each element in 'list1' using a for loop.
3. For each element in 'list1', check if the element is also present in 'list2' using an if-statement and the 'in' keyword.
4. If the element is present in both lists, append it to the 'output' list.
5. Once the loop finishes, the 'output' list will contain all the common elements.

Here is the Python code that implements this algorithm:
```
list1 = [1,2,3,4,5]
list2 = [2,4,5,6,7]
output = []

for elem in list1:
    if elem in list2:
        output.append(elem)

print(output)
```
This code will output the list `[2,4,5]`, which are the common elements in 'list1' and 'list2'.