Adding log based. Not working properly yet.