working version, with client UI to choose percentage
cleaner client logic (percentage)