javascript cleanup, deletes sorted out