updated code for modularity
update