simple atoi implementation