Removed uneeded functions, fixe J->j