Updated code in accordance to the library