Second commit - starting to write the threshold and blob functions