fixed some JSHint issues..cleaned code.