added a printf implementation

This pull request fixes #24