add a bunch of util functions and define basic riff