added atoi function, some other minor changes, extra comments...