updated code to test idea