Added a function for building the prompt