Switched to automatic relay switching rather than asking for user inputs. Fixed some small bugs.