added a constants object so the basic logic could be changed easily