Latest code. Working on python wrapper