Fixed the log order, added a "logElement" function.