Indentaion fixed. Minor bugs fixed.FINAL.