Cleaned up the code, removed bunch of redundant lines.