Annotated the cost method