add functional programing and assert