Some improvements I thought of last night...but it still is not good enough to compete with the current implementation