refactored back end just a tiny bit, for verbosity :)