added sammyjs and removed duplicate code