added internal variable that makes it work off in-memory array rather than a database