State machine to test. Button func. still buggy.