uglified bowling algorithm