cleaned up code, made log-measurement a one-to-one relationship