First stab at forward backward algorithm