Added some code modifications