Added block detection template
Added FSM