Removed tabs; modularized the code.