count + some stupid bugs