Remade costs calculation to what I wanted yesterday. Fixed a bit of frontend to autocopy Id.