finish some basic function written in toy