add pattern cases
add pattern cases