Moore Machine Functionality