fixed bugs, finished measurement framework