improve code, add examples