Resolved #18, optimized code trough JSLint