Solution for id:trick added, however way too slow.