Removed redundancy and refactored a lot of code. A LOT. Repaired anurags code. Again.