Tweaked revision history. Still need to add some more comments and clean the code before submission