Improved from my mypad version