removed calculating cost