really bad algorithm