Cleaned up both arduino and iOS code