adding intelligence to the back end