Update loop.cpp