sim improvements
i/o done
clean a bit