fixed inconsistent tabbing
optimize all code
Merge pull request #4 from mediocregopher/master

Fixed inconsistent tabbing, and optimized all code