making the code more flexible