changed code to include three more functions