Fixed array out of bounds issue
Fixed array out of bounds issue
Ready for JS