Work in progress
Working library and a demo program
Improvements