Moved according to Zibr's idea