fixed an indexing error that occurs when the core shape isnt square