Improved on fapping code