first version of worst fit... segfault dock