refactor home page and modded the index controller slightly