added necessary input and fixed errors