Fixed indentations, streamlined the code.