A little more, still need to finish logging code