added input
formated the code