Made a couple of changes to back-end logic