Implement sink state machine