added python implementation, also tested on itself to work; no unicode support yet