Add Log Function, move Variables