refactored to allow arbitrarily deep neural nets