added a function to clear code. will need to do quite a bit of clean up though