Append new functional. Fix bugs