Added camel function and modified main loop