add features and fix coding