Issue 5 transform

This pull request does many things (should close #43 and partly fullfill #5 and #8 ) .