fixed error and made some style changes