started compiling the code and fixed indexing issues.