fixed selection bug and credited Jonas