Initial commit adding code copied from janus