Refactoring JS, added varying colors for problems