Fixed computing number of blocks
Using structures instead of many arguments