Button logic

Try simplifying some of your statements to make the code more readable. For example

    if (stopgobuttonstate == HIGH)
    { 
      if (amigoing == 0) {

is the same as

    if (stopgobuttonstate == HIGH) &&  (amigoing == 0) 
  {