Getting back to Malus law

Debugging and tidying up