updated code with new libraries