removed stdio, where possible