Fixed print and add main loop