Foundations of Computer Science: Implementing finite state machines and lambda calculus