Cleaned up code for end.ino