Made some fixes and added an example file (work in progress)