added return value to be json_encoded
fixed object ref error
fixed last block value thats passed to build method
testing
fixed pool generation logic
removed unecessary param