minor code changes & formating code