simplified (no clue what I am doing) and added some comments to shut up flycheck