Printf standard function rewrite for educational proposes