working, but printf's are not well done yet