finishing up the backend