Initial version, working tests