Updated and organized da code