More work on code. Currently broken  because of inlined notes