bugfixing and adding a simple printf implementation