Finalised modifyAdd(), need to test it thoroughly.