removed unused functions
initial commit; some index refactoring
correct indexing and formating