Cleaned up LED code, still needs testing