a few file additions here and there
fixed Jelly impl and refactored a few codes