is this the same block that you have in main.py? can you make it a function and call the function in main?