Fix functions, added example