Cleaned up code and added back blink function