added some code to replace things