code changed and code formatted properly