running the code properly