redisinging the code