added embedding layer and better support for hidden inputs in recurrence relation