added pieces of code