Changed deta da routine slightly