Javascript Empty Array Element Restructuring Mortgage