Cleaned up code

Used JSHint